package com.zimin.cloud.file.controller.api;

import com.zimin.cloud.mine.pojo.file.business.FaceBO;
import com.zimin.shared.pojo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author zimin
 * @since 2021/10/27 5:27 下午
 */
@RequestMapping("/file/gridFs")
@Api(value = "文件上传GridFs", tags = {"文件上传GridFs"})
public interface IGridFsController {


    /**
     * 上传人脸识别图片
     *
     * @return
     */
    @ApiOperation(value = "上传人脸识别图片", notes = "上传人脸识别图片", httpMethod = "POST")
    @PostMapping("/uploadFace")
    Result uploadFace(@RequestBody FaceBO faceBO) throws Exception;

    /**
     * 查询人脸图片
     *
     * @return
     * @throws Exception
     */
    @GetMapping("/readInGridFs")
    void readInGridFs(@RequestParam String faceId,HttpServletResponse response) throws Exception;


    /**
     * 从gridFs中读取图片数据
     *
     * @param faceId
     * @return
     * @throws Exception
     */
    @GetMapping("/readFace64InGridFs")
    Result readFace64InGridFs(@RequestParam String faceId) throws Exception;

}
